clear;close all;
im1=imread('triangle.jpg');
im2=imread('cameraman.tif');
im1 =  im1(:,:,1);
im2 = im2(:,:,1);
im1 = imnoise(im1,'gaussia',0.001);
im2 = imnoise(im2,'gaussia',0.001);
im1 = gaussian_linear(im1,3,3);
im2 = gaussian_linear(im2,3,3);
im1 = gaussian_adaptive(im1,3);
im2 = gaussian_adaptive(im2,3);
bwim1=adaptivethreshold(im1,11,0.02,1);
bwim2=adaptivethreshold(im2,15,0.02,1);
subplot(2,2,1);
imshow(uint8(im1));
subplot(2,2,2);
imshow((bwim1));
subplot(2,2,3);
imshow(uint8(im2));
subplot(2,2,4);
imshow(bwim2);